﻿
namespace IndirectX.Shaders
{
    public class VersionCodeToken : ShaderCodeToken
    {
        public enum ShaderTypes
        {
            PixelShader = 0,
            VertexShader = 1,
            GeometryShader = 2,
            HullShader = 3,
            DomainShader = 4,
            ComputeShader = 5,
        }

        public uint Major;
        public uint Minor;
        public ShaderTypes Type;

        public override void Parse(uint data)
        {
            Major = BitExtensions.DecodeValue(data, 0, 7);
            Minor = BitExtensions.DecodeValue(data, 8, 15);
            Type = (ShaderTypes)BitExtensions.DecodeValue(data, 16, 31);
        }
    }
}